# Program to keep practicing anatomy.
# (C) J.Y.Amihud 2024
# License: GPL v3 or any later version.

import os
import sys
import random
import time

# Generating anatomy course.
def generate(amount=10):

    print("Generating...")
    #time.sleep(3)
    
    bodytypes = ["muscular", "skinny", "fat", "normal"]
    sexes = ["male", "female"]
    ages = ["baby", "child", "teenager", "adult", "middle-aged", "old"]
    parts = ["full-body", "torso", "back", "head", "arm", "hand", "leg", "foot"]

    output_list = []
    
    for i in range(amount):

        item = [False, random.choice(bodytypes),
                random.choice(sexes),
                random.choice(ages),
                random.choice(parts)]
        if "baby" in item:
            item[1] = "cute"
        if "child" in item and item[1] == "muscular":
            item[1] = "normal"
        output_list.append(item)

    print("Done!")
    return output_list


try:
    amount = int(sys.argv[1])
except:
    amount = 10
l = generate(amount)

def draw(l):

    done = 0
    
    for i in l:
        t = "[ ] "
        if i[0]:
            done = done + 1
            t = "[x] "
        
        print(t, i[1][0].upper()+i[1][1:], i[2], i[3], i[4])

    print("Done", int(done/len(l)*100), "%")

making = 0
while True:
    making = making + 1
    os.system("clear")

    if (making-1) % 5 == 0 and making != 1:
        print("Take a short break!")
        input()
        os.system("clear")
    
    draw(l)
    input()
    for b, i in enumerate(l):
        if not i[0]:
            l[b][0] = True
            break
    if b == len(l)-1:
        break
os.system("clear")
draw(l)
